package com.franklin.maven.localcleaner.ui;

import com.franklin.maven.localcleaner.repository.LocalRepositoryFinder;
import com.franklin.maven.localcleaner.ui.tree.LocalMavenTreeForm;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.RegisterToolWindowTask;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.maven.project.MavenProjectsManager;

import java.util.List;

/**
 * 插件窗口
 * @author: Ye Junhui
 * @since : 2022/4/1 0001
 */
public class PluginToolWindowFactory implements ToolWindowFactory {

    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        toolWindow.setIcon(PluginIcons.SERVICE);
        ContentFactory contentFactory = ContentFactory.getInstance();
        LocalMavenTreeForm localMavenTreeForm = new LocalMavenTreeForm();
        Content content = contentFactory.createContent(localMavenTreeForm.getMainPanel(), "Maven Local Jars", false);
        toolWindow.getContentManager().addContent(content);
    }
}
